package com.leyou.common.auth.domain;

public class UserHolder {

    private static ThreadLocal<Long> TL = new ThreadLocal<>();

    //从容器中取出当前线程存储的对象
    public static Long getId() {
        return TL.get();
    }

    //向容器中存入当前线程指定的对象
    public static void setId(Long id) {
        TL.set(id);
    }

    //从容器中移除当前线程存储的对象
    public static void remove(){
        TL.remove();
    }

}
